/**
 * Tasklist filter
 * 
 * adds an input form to the head of a tasklist to filter the tasklist
 * 
 * @author flobo <bosselmann@gmail.com>
 * 
 */
var plugin_showonlyopentasks = {
	
	box:new Element('div',{
		id:"showonlyopentasks",
		html:'hide finished tasks',
		styles:{ 'float': 'right', fontSize:'11px', padding:0, margin:0, marginTop:'5px'}
	}),
	
	checkbox:new Element('input',{
		type:"checkbox",
		styles:{'float':'left',padding:0, margin:0, marginRight:'2px',marginTop:'-2px' },
		id:"ch_showonlyopentasks",
	    'events': {
	        'click': function() {
	        	if(this.checked) {
					DOM.CSS.set('.t_row.ready',{display:'none'});
	        	} else {
	        		DOM.CSS.set('.t_row.ready',{display:'block'});
				}
	        }
	     }
	}),
	
	_drawTasklist:function() {
		this.box.inject($('tasklist'),'top');
		this.checkbox.inject(this.box,'top');
	}
}